﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title</title>

</head>
<body>

    <div class="container">
        <div class="row ">
            <div class="col-lg-12">
                <div class="body-content">
                    @* Banner *@
                    @Html.Action("Banner", "Common")

                    @* Menu *@
                    @Html.Action("Menu", "Common")

                    @* Slide *@
                    <div class="slide">
                        @Html.Action("Slide", "Common")
                    </div>
                    <div class="main-content">
                        @*Main content*@
                        <div class="col-lg-12 col-md-12">
                            @*  *@
                            <div class="row">
                                @RenderBody()
                            </div>
                            @*</div>*@
                        </div>
                        @Html.Action("Footer", "Common")
                    </div>
                </div>
            </div>
        </div>
    </div>

    @Scripts.Render("~/bundles/jquery")
    <script src="~/Scripts/jquery.stepy.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>


    @Styles.Render("~/Content/css/bootstrap")
    <link href="~/Content/css/jquery.stepy.css" rel="stylesheet" />

    <script>
        $(function () {
            $('form').stepy();
        });
    </script>
    <script type="text/javascript">
        var dulieu;
        // University
        $(document).ready(function () {

            $("#ProvinceID").change(function () {
                var provinceid = $(this).val();
                $("#CommuneID").html('').append($('<option/>', {
                    value: 0,
                    text: "Chọn Huyện..."
                }));
                $.getJSON("/Common/GetProvinceByCommune", { matinh: provinceid },
                       function (data) {
                           var select = $("#CommuneID");
                           select.empty();
                           select.append($('<option/>', {
                               value: 0,
                               text: "Chọn Huyện..."
                           }));
                           $.each(data, function (index, itemData) {
                               select.append($('<option/>', {
                                   value: itemData.Value,
                                   text: itemData.Text
                               }));
                           });
                       });
            });
            $("#ProvinceID2").change(function () {
                var provinceid2 = $(this).val();
                $("#HighSchoolID").html('').append($('<option/>', {
                    value: 0,
                    text: "Chọn Trường..."
                }));
                $.getJSON("/Common/GetHighSchoolByProvince", { matinh: provinceid2 },
                       function (data) {
                           var select = $("#HighSchoolID");
                           select.empty();
                           select.append($('<option/>', {
                               value: 0,
                               text: "Chọn Trường..."
                           }));
                           $.each(data, function (index, itemData) {
                               select.append($('<option/>', {
                                   value: itemData.Value,
                                   text: itemData.Text
                               }));
                           });
                       });
            });

            
            //$("#TrainingSystemID").change(function () {
            //    var TSID = $(this).val();
            //    $("#MonThiThem").html('')
            //    $.getJSON("/Common/GetGraduateSubjectBySubjectCustom", { mamon: graduatesubjectid },
            //           function (data) {
            //               var select = $("#MonThiThem");
            //               select.empty();
            //               $.each(data, function (index, itemData) {
            //                   select.append('<input type="checkbox" name="checkbox' + index + '" value="' + itemData.Value + '"/>  ' + itemData.Text + '<br/>');
            //               });
            //           });
            //});

            

            $('.button-next').click(function () {

               // if ($('#step-1').children().length > 0) return;
                if ($('#step-1').data('id') == $('#ddlTraningSystem').val())
                    return;
                else
                    $('#step-1').data('id', $('#ddlTraningSystem').val())

                if ($('#ddlTraningSystem').val() == 0) {
          
                    $.ajax({
                        url: '/Common/Step2_Examination',
                        dataType: 'html',
                        success: function (data) {
                            //alert('0')
                            $('#step-1').html('');
                            $('#step-1').html(data);
                        }
                    });
                }
                else if ($('#ddlTraningSystem').val() == 1) {
                    
                    $.ajax({
                        url: '/Common/Step2_RecruitingBasic',
                        dataType: 'html',
                        success: function (data) {
                            //alert('1')
                            $('#step-1').html('');
                            $('#step-1').html(data);
                        }
                    });
                }
                else {
                    $.ajax({
                        url: '/Common/Step2_Recruiting',
                        dataType: 'html',
                        success: function (data) {
                            //alert('2')
                            $('#step-1').html('');
                            $('#step-1').html(data);
                            $()
                        }
                    });
                }
            });
            //$('.button-back').click(function () {
            //    if ($('#step-1').children().length > 0) return;
            //    //if ($('#TrangThaiDangKi').val() == 0) {
            //    //    $('#thituyen').toggleClass('hide')
            //    //}
            //    //else if ($('#TrangThaiDangKi').val() == 1) {
            //    //    $('#xettuyen').toggleClass('hide')

            //    //}
            //    //else {
            //    //    $('.xettuyenDH').toggleClass('hide')
            //    //}

            //});
        });
        // Vocational school
        $("#GroupVocationalID").change(function () {
            $("#PhylumVocationalID").html('').append($('<option/>', {
                value: 0,
                text: "Chọn Ngành..."
            }));
            var groupid = $(this).val();
            $.getJSON("/Common/GetPhylumByGroupVocational", { makhoithi: groupid },
                   function (data) {
                       var select = $("#PhylumVocationalID");
                       select.empty();
                       select.append($('<option/>', {
                           value: 0,
                           text: "Chọn Ngành..."
                       }));
                       $.each(data, function (index, itemData) {
                           select.append($('<option/>', {
                               value: itemData.Value,
                               text: itemData.Text
                           }));
                       });
                   });
        });
        $("#PhylumVocationalID").change(function () {
            var phylumid = $(this).val();
            $("#MajorVocationalID").html('').append($('<option/>', {
                value: 0,
                text: "Chọn Chuyên ngành..."
            }));
            $.getJSON("/Common/GetMajorByPhylum", { manganh: phylumid },
                   function (data) {
                       var select = $("#MajorVocationalID");
                       select.empty();
                       select.append($('<option/>', {
                           value: 0,
                           text: "Chọn Chuyên ngành..."
                       }));
                       $.each(data, function (index, itemData) {
                           select.append($('<option/>', {
                               value: itemData.Value,
                               text: itemData.Text
                           }));
                       });
                   });
        });
        $("#ProvinceVocationalID").change(function () {
            var provinceid = $(this).val();
            $("#CommuneVocationalID").html('').append($('<option/>', {
                value: 0,
                text: "Chọn Huyện..."
            }));
            $.getJSON("/Common/GetProvinceByCommune", { matinh: provinceid },
                   function (data) {
                       var select = $("#CommuneVocationalID");
                       select.empty();
                       select.append($('<option/>', {
                           value: 0,
                           text: "Chọn Huyện..."
                       }));
                       $.each(data, function (index, itemData) {
                           select.append($('<option/>', {
                               value: itemData.Value,
                               text: itemData.Text
                           }));
                       });
                   });
        });
        $("#ProvinceVocationalID2").change(function () {
            var provinceid2 = $(this).val();
            $("#HighSchoolVocationalID").html('').append($('<option/>', {
                value: 0,
                text: "Chọn Trường..."
            }));
            $.getJSON("/Common/GetHighSchoolByProvince", { matinh: provinceid2 },
                   function (data) {
                       var select = $("#HighSchoolVocationalID");
                       select.empty();
                       select.append($('<option/>', {
                           value: 0,
                           text: "Chọn Trường..."
                       }));
                       $.each(data, function (index, itemData) {
                           select.append($('<option/>', {
                               value: itemData.Value,
                               text: itemData.Text
                           }));
                       });
                   });
        });

        // Chọn drop hình thức tuyển sinh 

        //$("#ddlTraningSystem").change(function (data) {
        //    //var traningsystemid = $(this).val();
        //    var select = $("#ddlTraningSystem");
        //    $.each(data, function (index, itemData) {
        //        select.append($('<option/>', {
        //            value: itemData.Value,
        //            text: itemData.Text
        //        }));
        //    });
        //    //$("#HighSchoolVocationalID").html('').append($('<option/>', {
        //    //    value: 0,
        //    //    text: "Chọn Trường..."
        //    //}));
        //    if (itemData.Text == "Đăng ký hồ sơ thi tuyển") {
        //        $.getJSON("/Common/Step2_Examination")
        //    }
        //    //$.getJSON("/Common/GetHighSchoolByProvince", { matinh: provinceid2 },
        //    //       function (data) {
        //    //           var select = $("#HighSchoolVocationalID");
        //    //           select.empty();
        //    //           select.append($('<option/>', {
        //    //               value: 0,
        //    //               text: "Chọn Trường..."
        //    //           }));
        //    //           $.each(data, function (index, itemData) {
        //    //               select.append($('<option/>', {
        //    //                   value: itemData.Value,
        //    //                   text: itemData.Text
        //    //               }));
        //    //           });
        //    //       });
        //});
    </script>
</body>
</html>